home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 43.zip / ANC 15.adf / demo / demo.c < prev    next >
C/C++ Source or Header  |  1987-01-01  |  2KB  |  71 lines

  1. char *a_cmd[] = {"sdb","-sbarchart","-mbc.r","bc",0};
  2. char *b_cmd[] = {"sdb","-mcount.r","count","count.txt",0};
  3. char *c_cmd[] = {"sdb","-mpi.r","pi","50",0};
  4.  
  5. main()
  6. {
  7.     char a[10];
  8.     int invalid;
  9.  
  10.     setenv("SDBOPT", "-cs1,3,2,0 -cc0,0,1,2 -cd1,2");
  11.     scr_clear();
  12.     printf("\n\n         Welcome to the Aztec C68K SDB debugger demo!\n");
  13.     printf("          --------------------------------------------\n\n");
  14. #ifdef DEMO
  15.     printf("        This disk may be freely copied and distributed.\n\n");
  16. #endif
  17.     printf("        Manx software users now have access to the first\n");
  18.     printf("        true source level debugger for the Amiga computer.\n\n");
  19.     printf("       As you'll soon see, SDB for the Amiga not only gives\n");
  20.     printf("       you access to your C source, but is a multi-windowed\n");
  21.     printf("       debugger with many powerful yet user friendly features.\n\n");
  22. #if 0
  23.     printf("The windows may be resized and their contents scrolled\n");
  24.     printf("using either the mouse or keyboard equivalents.  Keyboard\n");
  25.     printf("commands entered in the command window may be recalled and\n");
  26.     printf("edited using an inteligent command history.\n\n");
  27. #endif
  28.     printf("       Several demonstration programs are included on this disk.\n");
  29.     printf("       Before actually running them you may want to look at\n");
  30.     printf("       the documentation found in the file named sdb.doc\n\n");
  31.     printf("       Would you like to exit to view the documentation?");
  32.     gets(a);
  33.     if (a[0] == 'y' || a[0] == 'Y') {
  34.         printf("\nReturning to Amiga DOS.\n\n");
  35.         exit(0);
  36.     }
  37.     while (1) {
  38.         scr_clear();
  39.         printf("\n\n\n\n                   Available Demonstration Programs\n");
  40.         printf("                   --------------------------------\n\n\n");
  41.         printf("                   1) Draw a bar chart in a window.\n\n");
  42.         printf("                   2) Count characters in a file.\n\n");
  43.         printf("                   3) Calculate the value of pi.\n\n");
  44.         printf("                   4) Exit to Amiga DOS.\n\n\n");
  45.         do {
  46.             invalid = 0;
  47.             printf("                Enter selection:");
  48.             gets(a);
  49.             switch(atoi(a)) {
  50.                 case 1:    scr_clear();
  51.                         fexecv(a_cmd[0],a_cmd);
  52.                         break;
  53.                 case 2:    scr_clear();
  54.                         fexecv(b_cmd[0],b_cmd);
  55.                         break;
  56.                 case 3:    scr_clear();
  57.                         fexecv(c_cmd[0],c_cmd);
  58.                         break;
  59.                 case 4:    scr_clear();
  60.                         exit(0);
  61.                 default:
  62.                         printf("Invalid option, please try again.\n");
  63.                         invalid = 1;
  64.             }
  65. #if 0
  66.             scr_clear();
  67. #endif
  68.         } while(invalid);
  69.     }
  70. }
  71.